﻿using System;
using System.Data;
using System.Collections.Generic;
using FiberRMS.Model.AlarmManager;
namespace FiberRMS.BLL.AlarmManager
{
	/// <summary>
	/// 业务逻辑类ALARM_GUIFILTERMAP 的摘要说明。
	/// </summary>
	public class ALARM_GUIFILTERMAP
	{
		private readonly FiberRMS.DAL.AlarmManager.ALARM_GUIFILTERMAP dal=new FiberRMS.DAL.AlarmManager.ALARM_GUIFILTERMAP();
		public ALARM_GUIFILTERMAP()
		{}
		#region  成员方法
        public DataTable GetTransUGM(string userid)
        {
            return dal.GetTransUGM(userid);
        }
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(string GUIFILTERNAME)
		{
			return dal.Exists(GUIFILTERNAME);
		}

		/// <summary>
		/// 增加一条数据
		/// </summary>
		public void Add(FiberRMS.Model.AlarmManager.ALARM_GUIFILTERMAP model)
		{
			dal.Add(model);
		}

		/// <summary>
		/// 更新一条数据
		/// </summary>
		public void Update(FiberRMS.Model.AlarmManager.ALARM_GUIFILTERMAP model)
		{
			dal.Update(model);
		}

		/// <summary>
		/// 删除一条数据
		/// </summary>
		public void Delete(string GUIFILTERNAME)
		{
			
			dal.Delete(GUIFILTERNAME);
		}

		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public FiberRMS.Model.AlarmManager.ALARM_GUIFILTERMAP GetModel(string GUIFILTERNAME)
		{
			
			return dal.GetModel(GUIFILTERNAME);
		}

		/// <summary>
		/// 获得数据列表
		/// </summary>
		public DataSet GetList(string strWhere)
		{
			return dal.GetList(strWhere);
		}
		/// <summary>
		/// 获得数据列表
		/// </summary>
		public List<FiberRMS.Model.AlarmManager.ALARM_GUIFILTERMAP> GetModelList(string strWhere)
		{
			DataSet ds = dal.GetList(strWhere);
			List<FiberRMS.Model.AlarmManager.ALARM_GUIFILTERMAP> modelList = new List<FiberRMS.Model.AlarmManager.ALARM_GUIFILTERMAP>();
			int rowsCount = ds.Tables[0].Rows.Count;
			if (rowsCount > 0)
			{
				FiberRMS.Model.AlarmManager.ALARM_GUIFILTERMAP model;
				for (int n = 0; n < rowsCount; n++)
				{
					model = new FiberRMS.Model.AlarmManager.ALARM_GUIFILTERMAP();
					model.USERID=ds.Tables[0].Rows[n]["USERID"].ToString();
					model.GUIFILTERNAME=ds.Tables[0].Rows[n]["GUIFILTERNAME"].ToString();
					model.RESOURCEID=ds.Tables[0].Rows[n]["RESOURCEID"].ToString();
					model.ALARMTYPE=ds.Tables[0].Rows[n]["ALARMTYPE"].ToString();
					model.ALARMLEVEL=ds.Tables[0].Rows[n]["ALARMLEVEL"].ToString();
					model.VENDOR=ds.Tables[0].Rows[n]["VENDOR"].ToString();
					model.ISUSED=ds.Tables[0].Rows[n]["ISUSED"].ToString();
					modelList.Add(model);
				}
			}
			return modelList;
		}

		/// <summary>
		/// 获得数据列表
		/// </summary>
		public DataSet GetAllList()
		{
			return dal.GetList("");
		}

		/// <summary>
		/// 获得数据列表
		/// </summary>
		//public DataSet GetList(int PageSize,int PageIndex,string strWhere)
		//{
			//return dal.GetList(PageSize,PageIndex,strWhere);
		//}

		#endregion  成员方法
	}
}

